package com.yjd.comm.enums;

/**
 * <b>description</b>：性别 <br>
 * <b>time</b>：2014-11-14下午2:57:32 <br>
 * <b>author</b>： ready likun_557@163.com
 */
public enum SexEnum {

	UNKNOW(0, "未知"), MAN(1, "男"), WOMAN(2, "女");
	private SexEnum(Integer value, String description) {
		this.value = value;
		this.description = description;
	}

	private Integer value;
	private String description;

	public Integer getValue() {
		return value;
	}

	public String getDescription() {
		return description;
	}

	public static SexEnum get(Integer value) {
		SexEnum[] sexs = SexEnum.values();
		for (SexEnum sexEnum : sexs) {
			if (sexEnum.getValue().equals(value)) {
				return sexEnum;
			}
		}
		return null;
	}

	public static String getDesc(Integer value) {
		SexEnum[] sexs = SexEnum.values();
		for (SexEnum sexEnum : sexs) {
			if (sexEnum.getValue().equals(value)) {
				return sexEnum.getDescription();
			}
		}
		return null;
	}

}
